package com.manager.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

@NoArgsConstructor
@Data
@AllArgsConstructor
public class User {
  private Long id;
  private String userName;
  private Integer sex;
  private String email;
  private String phone;
  private String password;
  private String ipaddr;
  private Integer status;
  private String avatar;
  @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
  private Timestamp createdTime;
  @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
  private Timestamp updateTime;
  private String remarks;

  public User(String userName, String email, String password, String ipaddr) {
    this.userName = userName;
    this.email = email;
    this.password = password;
    this.ipaddr = ipaddr;
    this.createdTime = new Timestamp(System.currentTimeMillis());
    this.updateTime = new Timestamp(System.currentTimeMillis());
  }
}
